package com.kili.db.lit;

import javax.persistence.*;
import java.util.Objects;

/**
 * @date 19-11-2
 * @auther jackliang
 * @description TODO
 */
@Entity
@Table(name = "k_user_permission", schema = "permission", catalog = "")
public class KUserPermissionEntity {
    private int id;
    private int userId;
    private int permissionId;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "permission_id", nullable = false)
    public int getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(int permissionId) {
        this.permissionId = permissionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        KUserPermissionEntity that = (KUserPermissionEntity) o;
        return id == that.id &&
                userId == that.userId &&
                permissionId == that.permissionId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, permissionId);
    }
}
